<template>
  <div class="m-progress" :style="`width:${width}px;`">
    <div class="m-progress-outer">
      <div class="m-progress-inner">
        <div
          class="u-progress-bg"
          :style="`width: ${
            progress >= 100 ? 100 : progress
          }%;background-color: ${color};`"
        ></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'my-Progress',
  props: {
    width: {
      // 进度条总宽度
      type: Number,
      default: 600
    },
    progress: {
      // 当前进度
      type: Number,
      default: 36
    },
    color: {
      type: String,
      default: '1890FF'
    }
  }
}
</script>
  <style lang="less" scoped>
.m-progress {
  height: 5px;
  margin: 0 auto;
  display: flex;
  .m-progress-outer {
    width: 100%;
    .m-progress-inner {
      display: inline-block;
      width: 100%;
      background: #f5f5f5;
      border-radius: 100px;
      .u-progress-bg {
        height: 5px;
        border-radius: 100px;
        transition: all 0.3s cubic-bezier(0.08, 0.82, 0.17, 1);
      }
    }
  }
}
</style>
